-- Constants.lua
-- June 2014

local addon, ns = ...
local Hekili = _G[ addon ]

local GetSpecialization = function() return GetActiveTalentGroup() end
local GetSpecializationInfo = function()
    local name, baseName, id = UnitClass( "player" )
    return id, baseName, name
end

-- Class Localization
ns.getLocalClass = function ( class )
    if not ns.player.sex then ns.player.sex = UnitSex( "player" ) end
    return ns.player.sex == 1 and LOCALIZED_CLASS_NAMES_MALE[ class ] or LOCALIZED_CLASS_NAMES_FEMALE[ class ]
end


local InverseDirection = {
    LEFT = "RIGHT",
    RIGHT = "LEFT",
    TOP = "BOTTOM",
    BOTTOM = "TOP"
}

ns.getInverseDirection = function ( dir )

    return InverseDirection[ dir ] or dir

end


local ClassIDs = {}

for i = 1, GetNumClasses() do
    local _, classTag = GetClassInfo( i )
    if classTag then ClassIDs[ classTag ] = i end
end

ns.getClassID = function( class )
    return ClassIDs[ class ] or -1
end


local ResourceInfo = {
    -- health       = Enum.PowerType.HealthCost,
    none            = Enum.PowerType.None,
    mana            = Enum.PowerType.Mana,
    rage            = Enum.PowerType.Rage,
    focus           = Enum.PowerType.Focus,
    energy          = Enum.PowerType.Energy,
    combo_points    = Enum.PowerType.ComboPoints,
    runes           = Enum.PowerType.Runes,
    runic_power     = Enum.PowerType.RunicPower,
    soul_shards     = Enum.PowerType.SoulShards,
    astral_power    = Enum.PowerType.LunarPower,
    holy_power      = Enum.PowerType.HolyPower,
    alternate       = Enum.PowerType.Alternate,
    maelstrom       = Enum.PowerType.Maelstrom,
    chi             = Enum.PowerType.Chi,
    insanity        = Enum.PowerType.Insanity,
    obsolete        = Enum.PowerType.Obsolete,
    obsolete2       = Enum.PowerType.Obsolete2,
    arcane_charges  = Enum.PowerType.ArcaneCharges,
    fury            = Enum.PowerType.Fury,
    pain            = Enum.PowerType.Pain,
    essence         = Enum.PowerType.Essence,
    blood_runes     = Enum.PowerType.RuneBlood,
    frost_runes     = Enum.PowerType.RuneFrost,
    unholy_runes    = Enum.PowerType.RuneUnholy,
}

local ResourceByID = {}

for k, powerType in pairs( ResourceInfo ) do
    ResourceByID[ powerType ] = k
end


function ns.GetResourceInfo()
    return ResourceInfo
end


function ns.GetResourceID( key )
    return ResourceInfo[ key ]
end


function ns.GetResourceKey( id )
    return ResourceByID[ id ]
end


local passive_regen = {
    mana = 1,
    focus = 1,
    energy = 1
}

function ns.ResourceRegenerates( key )
    -- Does this resource have a passive gain from waiting?
    if passive_regen[ key ] then return true end
    return false
end


local Specializations = {
    death_knight_blood = 250,
    death_knight_frost = 251,
    death_knight_unholy = 252,

    druid_balance = 102,
    druid_feral = 103,
    druid_guardian = 104,
    druid_restoration = 105,

    hunter_beast_mastery = 253,
    hunter_marksmanship = 254,
    hunter_survival = 255,

    mage_arcane = 62,
    mage_fire = 63,
    mage_frost = 64,

    monk_brewmaster = 268,
    monk_windwalker = 269,
    monk_mistweaver = 270,

    paladin_holy = 65,
    paladin_protection = 66,
    paladin_retribution = 70,

    priest_discipline = 256,
    priest_holy = 257,
    priest_shadow = 258,

    rogue_assassination = 259,
    rogue_outlaw = 260,
    rogue_subtlety = 261,

    shaman_elemental = 262,
    shaman_enhancement = 263,
    shaman_restoration = 264,

    warlock_affliction = 265,
    warlock_demonology = 266,
    warlock_destruction = 267,

    warrior_arms = 71,
    warrior_fury = 72,
    warrior_protection = 73,

    demonhunter_havoc = 577,
    demonhunter_vengeance = 581,

    evoker_devastation = 1467,
    evoker_preservation = 1468,
}


local SpecializationKeys = {
    -- Classes (for Wrath)
    [1] = "warrior",
    [2] = "paladin",
    [3] = "hunter",
    [4] = "rogue",
    [5] = "priest",
    [6] = "deathknight",
    [7] = "shaman",
    [8] = "mage",
    [9] = "warlock",
    [10] = "monk",
    [11] = "druid",
    [12] = "demonhunter",
    [13] = "evoker",

    [250] = "blood",
    [251] = "frost",
    [252] = "unholy",

    [577] = "havoc",
    [581] = "vengeance",

    [102] = "balance",
    [103] = "feral",
    [104] = "guardian",
    [105] = "restoration",

    [1467] = "devastation",
    [1468] = "preservation",

    [253] = "beast_mastery",
    [254] = "marksmanship",
    [255] = "survival",

    [62] = "arcane",
    [63] = "fire",
    [64] = "frost",

    [268] = "brewmaster",
    [269] = "windwalker",
    [270] = "mistweaver",

    [65] = "holy",
    [66] = "protection",
    [70] = "retribution",

    [256] = "discipline",
    [257] = "holy",
    [258] = "shadow",

    [259] = "assassination",
    [260] = "outlaw",
    [261] = "subtlety",

    [262] = "elemental",
    [263] = "enhancement",
    [264] = "restoration",

    [265] = "affliction",
    [266] = "demonology",
    [267] = "destruction",

    [71] = "arms",
    [72] = "fury",
    [73] = "protection",
}

ns.getSpecializationKey = function ( id )
    return SpecializationKeys[ id ] or "none"
end

ns.getSpecializationID = function ( index )
    return GetSpecializationInfo( index or GetSpecialization() or 0 )
end


ns.FrameStratas = {
    "BACKGROUND",
    "LOW",
    "MEDIUM",
    "HIGH",
    "DIALOG",
    "FULLSCREEN",
    "FULLSCREEN_DIALOG",
    "TOOLTIP",

    BACKGROUND = 1,
    LOW = 2,
    MEDIUM = 3,
    HIGH = 4,
    DIALOG = 5,
    FULLSCREEN = 6,
    FULLSCREEN_DIALOG = 7,
    TOOLTIP = 8
}


if Hekili.IsWrath() then
    ns.WrathTalentToSpellID = {
        [23] = { 11083, 12351 },
        [24] = { 11094, 13043 },
        [25] = { 11095, 12872, 12873 },
        [26] = { 11069, 12338, 12339, 12340, 12341 },
        [27] = { 11078, 11080 },
        [28] = { 11100, 12353 },
        [29] = { 11366 },
        [30] = { 11103, 12357, 12358 },
        [31] = { 11108, 12349, 12350 },
        [32] = { 11113 },
        [33] = { 11115, 11367, 11368 },
        [34] = { 11119, 11120, 12846, 12847, 12848 },
        [35] = { 11124, 12378, 12398, 12399, 12400 },
        [36] = { 11129 },
        [37] = { 11070, 12473, 16763, 16765, 16766 },
        [38] = { 11071, 12496, 12497 },
        [61] = { 11151, 12952, 12953 },
        [62] = { 31670, 31672, 55094 },
        [63] = { 11185, 12487, 12488 },
        [64] = { 11190, 12489, 12490 },
        [65] = { 11175, 12569, 12571 },
        [66] = { 11160, 12518, 12519 },
        [67] = { 11170, 12982, 12983 },
        [68] = { 11180, 28592, 28593 },
        [69] = { 12472 },
        [70] = { 11189, 28332 },
        [71] = { 11426 },
        [72] = { 11958 },
        [73] = { 11207, 12672, 15047 },
        [74] = { 11210, 12592 },
        [75] = { 11213, 12574, 12575, 12576, 12577 },
        [76] = { 11222, 12839, 12840 },
        [77] = { 11232, 12500, 12501, 12502, 12503 },
        [80] = { 11237, 12463, 12464, 16769, 16770 },
        [81] = { 11242, 12467, 12469 },
        [82] = { 11247, 12606 },
        [83] = { 11252, 12605 },
        [85] = { 28574, 54658, 54659 },
        [86] = { 12043 },
        [87] = { 12042 },
        [88] = { 11255, 12598 },
        [121] = { 12834, 12849, 12867 },
        [123] = { 12281, 12812, 12813, 12814, 12815 },
        [124] = { 12282, 12663, 12664 },
        [125] = { 12284, 12701, 12702, 12703, 12704 },
        [126] = { 12285, 12697 },
        [127] = { 12286, 12658 },
        [128] = { 12295, 12676, 12677 },
        [129] = { 12289, 12668, 23695 },
        [130] = { 16462, 16463, 16464, 16465, 16466 },
        [131] = { 12290, 12963 },
        [132] = { 12700, 12781, 12783, 12784, 12785 },
        [133] = { 12328 },
        [134] = { 20504, 20505 },
        [135] = { 12294 },
        [136] = { 12163, 12711, 12712 },
        [137] = { 12296 },
        [138] = { 12297, 12750, 12751, 12752, 12753 },
        [140] = { 12299, 12761, 12762, 12763, 12764 },
        [141] = { 12287, 12665, 12666 },
        [142] = { 12301, 12818 },
        [144] = { 50685, 50686, 50687 },
        [146] = { 12308, 12810, 12811 },
        [147] = { 12797, 12799 },
        [148] = { 50720 },
        [149] = { 12311, 12958 },
        [150] = { 12312, 12803 },
        [151] = { 12313, 12804 },
        [152] = { 12809 },
        [153] = { 12975 },
        [154] = { 12318, 12857, 12858, 12860, 12861 },
        [155] = { 12317, 13045, 13046, 13047, 13048 },
        [156] = { 12319, 12971, 12972, 12973, 12974 },
        [157] = { 12320, 12852, 12853, 12855, 12856 },
        [158] = { 12321, 12835 },
        [159] = { 12322, 12999, 13000, 13001, 13002 },
        [160] = { 12323 },
        [161] = { 12324, 12876, 12877, 12878, 12879 },
        [165] = { 12292 },
        [166] = { 12329, 12950, 20496 },
        [167] = { 23881 },
        [181] = { 13705, 13832, 13843, 13844, 13845 },
        [182] = { 13706, 13804, 13805, 13806, 13807 },
        [184] = { 13709, 13800, 13801, 13802, 13803 },
        [186] = { 13712, 13788, 13789 },
        [187] = { 13713, 13853, 13854 },
        [201] = { 13732, 13863 },
        [203] = { 13741, 13793, 13792 },
        [204] = { 13742, 13872 },
        [205] = { 13750 },
        [206] = { 13754, 13867 },
        [221] = { 13715, 13848, 13849, 13851, 13852 },
        [222] = { 13743, 13875 },
        [223] = { 13877 },
        [241] = { 13958, 13970, 13971 },
        [242] = { 13960, 13961, 13962, 13963, 13964 },
        [244] = { 13975, 14062, 14063 },
        [245] = { 13976, 13979, 13980 },
        [246] = { 13983, 14070, 14071 },
        [247] = { 13981, 14066 },
        [261] = { 14057, 14072 },
        [262] = { 14076, 14094 },
        [263] = { 14079, 14080 },
        [265] = { 14082, 14083 },
        [268] = { 14113, 14114, 14115, 14116, 14117 },
        [269] = { 14128, 14132, 14135, 14136, 14137 },
        [270] = { 14138, 14139, 14140, 14141, 14142 },
        [272] = { 14144, 14148 },
        [273] = { 14156, 14160, 14161 },
        [274] = { 14158, 14159 },
        [276] = { 14162, 14163, 14164 },
        [277] = { 13733, 13865, 13866 },
        [278] = { 14168, 14169 },
        [279] = { 14174, 14175, 14176 },
        [280] = { 14177 },
        [281] = { 58426 },
        [283] = { 14186, 14190, 14193, 14194, 14195 },
        [284] = { 14185 },
        [301] = { 14251 },
        [303] = { 14278 },
        [321] = { 14531, 14774 },
        [322] = { 10060 },
        [341] = { 14520, 14780, 14781 },
        [342] = { 14522, 14788, 14789, 14790, 14791 },
        [343] = { 14748, 14768, 14769 },
        [344] = { 14749, 14767 },
        [346] = { 14747, 14770, 14771 },
        [347] = { 14521, 14776, 14777 },
        [348] = { 14751 },
        [350] = { 14750, 14772 },
        [351] = { 63574 },
        [352] = { 14523, 14784, 14785 },
        [361] = { 14892, 15362, 15363 },
        [381] = { 14183 },
        [382] = { 14983 },
        [401] = { 14889, 15008, 15009, 15010, 15011 },
        [402] = { 14901, 15028, 15029, 15030, 15031 },
        [403] = { 14909, 15017 },
        [404] = { 14898, 15349, 15354, 15355, 15356 },
        [406] = { 14908, 15020, 17191 },
        [408] = { 14912, 15013, 15014 },
        [410] = { 14913, 15012 },
        [411] = { 27900, 27901, 27902, 27903, 27904 },
        [413] = { 14911, 15018 },
        [421] = { 15058, 15059, 15060 },
        [442] = { 19236 },
        [461] = { 15257, 15331, 15332 },
        [462] = { 15259, 15307, 15308, 15309, 15310 },
        [463] = { 15260, 15327, 15328 },
        [465] = { 15270, 15335, 15336 },
        [466] = { 15318, 15272, 15320 },
        [481] = { 15273, 15312, 15313, 15314, 15316 },
        [482] = { 15275, 15317 },
        [483] = { 15274, 15311 },
        [484] = { 15286 },
        [501] = { 15407 },
        [521] = { 15473 },
        [541] = { 15487 },
        [542] = { 15392, 15448 },
        [561] = { 16038, 16160, 16161 },
        [562] = { 16041 },
        [563] = { 16035, 16105, 16106, 16107, 16108 },
        [564] = { 16039, 16109, 16110, 16111, 16112 },
        [565] = { 16089, 60184, 60185, 60187, 60188 },
        [567] = { 16086, 16544 },
        [573] = { 16166 },
        [574] = { 16164 },
        [575] = { 16040, 16113, 16114, 16115, 16116 },
        [581] = { 16176, 16235, 16240 },
        [582] = { 55198 },
        [583] = { 16180, 16196, 16198 },
        [586] = { 16182, 16226, 16227, 16228, 16229 },
        [587] = { 16181, 16230, 16232 },
        [588] = { 16187, 16205, 16206 },
        [589] = { 16184, 16209 },
        [590] = { 16190 },
        [591] = { 16188 },
        [592] = { 16178, 16210, 16211, 16212, 16213 },
        [593] = { 16179, 16214, 16215, 16216, 16217 },
        [594] = { 16194, 16218, 16219, 16220, 16221 },
        [595] = { 16173, 16222, 16223, 16224, 16225 },
        [601] = { 16254, 16271, 16272 },
        [602] = { 16256, 16281, 16282, 16283, 16284 },
        [605] = { 16262, 16287 },
        [607] = { 16261, 16290, 51881 },
        [609] = { 16258, 16293 },
        [610] = { 16259, 16295, 52456 },
        [611] = { 16266, 29079, 29080 },
        [613] = { 16255, 16302, 16303, 16304, 16305 },
        [614] = { 17485, 17486, 17487, 17488, 17489 },
        [615] = { 16252, 16306, 16307, 16308, 16309 },
        [616] = { 16268 },
        [617] = { 43338 },
        [641] = { 12300, 12959, 12960 },
        [661] = { 16487, 16489, 16492 },
        [662] = { 16493, 16494 },
        [681] = { 16511 },
        [682] = { 16513, 16514, 16515 },
        [702] = { 16538, 16539, 16540, 16541, 16542 },
        [721] = { 16578, 16579, 16580, 16581, 16582 },
        [741] = { 16757, 16758 },
        [762] = { 16814, 16815, 16816, 16817, 16818 },
        [763] = { 16821, 16822 },
        [764] = { 16819, 16820 },
        [782] = { 16836, 16839, 16840 },
        [783] = { 16845, 16846, 16847 },
        [784] = { 16850, 16923, 16924 },
        [788] = { 5570 },
        [789] = { 16880, 61345, 61346 },
        [790] = { 16896, 16897, 16899 },
        [792] = { 16909, 16910, 16911, 16912, 16913 },
        [793] = { 24858 },
        [794] = { 16929, 16930, 16931 },
        [795] = { 16858, 16859, 16860, 16861, 16862 },
        [796] = { 16934, 16935, 16936, 16937, 16938 },
        [797] = { 16940, 16941 },
        [798] = { 16942, 16943, 16944 },
        [799] = { 16947, 16948, 16949 },
        [801] = { 37116, 37117 },
        [802] = { 16966, 16968 },
        [803] = { 16972, 16974, 16975 },
        [804] = { 49377 },
        [805] = { 16998, 16999 },
        [807] = { 17002, 24866 },
        [808] = { 17003, 17004, 17005, 17006, 24894 },
        [809] = { 17007 },
        [821] = { 17050, 17051 },
        [822] = { 17056, 17058, 17059, 17060, 17061 },
        [823] = { 17063, 17065, 17066 },
        [824] = { 17069, 17070, 17071, 17072, 17073 },
        [825] = { 17074, 17075, 17076, 17077, 17078 },
        [826] = { 16833, 16834, 16835 },
        [827] = { 16864 },
        [828] = { 17104, 24943, 24944, 24945, 24946 },
        [829] = { 17106, 17107, 17108 },
        [830] = { 17111, 17112, 17113 },
        [831] = { 17116 },
        [841] = { 17118, 17119, 17120 },
        [842] = { 17123, 17124 },
        [843] = { 24968, 24969, 24970, 24971, 24972 },
        [844] = { 18562 },
        [881] = { 17322, 17323 },
        [901] = { 17364 },
        [941] = { 17778, 17779, 17780 },
        [943] = { 17788, 17789, 17790, 17791, 17792 },
        [944] = { 17793, 17796, 17801, 17802, 17803 },
        [961] = { 17815, 17833, 17834 },
        [963] = { 17877 },
        [964] = { 17917, 17918 },
        [965] = { 17927, 17929, 17930 },
        [966] = { 17954, 17955, 17956, 17957, 17958 },
        [967] = { 17959, 59738, 59739, 59740, 59741 },
        [968] = { 17962 },
        [981] = { 18130 },
        [982] = { 18119, 18120 },
        [983] = { 18126, 18127 },
        [985] = { 18135, 18136 },
        [986] = { 18096, 18073, 63245 },
        [1001] = { 17783, 17784, 17785 },
        [1002] = { 18094, 18095 },
        [1003] = { 17810, 17811, 17812, 17813, 17814 },
        [1004] = { 17804, 17805 },
        [1005] = { 18174, 18175, 18176 },
        [1006] = { 18179, 18180 },
        [1007] = { 18182, 18183 },
        [1021] = { 18218, 18219 },
        [1022] = { 18220 },
        [1041] = { 63108 },
        [1042] = { 18271, 18272, 18273, 18274, 18275 },
        [1061] = { 18288 },
        [1081] = { 18223 },
        [1101] = { 18213, 18372 },
        [1122] = { 18427, 18428, 18429, 61330, 61331 },
        [1123] = { 14171, 14172, 14173 },
        [1141] = { 18459, 18460, 54734 },
        [1142] = { 18462, 18463, 18464 },
        [1162] = { 61336 },
        [1181] = { 18530, 18531, 18533, 18534, 18535 },
        [1201] = { 18551, 18552, 18553, 18554, 18555 },
        [1202] = { 52795, 52797, 52798, 52799, 52800 },
        [1221] = { 18692, 18693 },
        [1222] = { 18694, 18695, 18696 },
        [1223] = { 18697, 18698, 18699 },
        [1224] = { 18703, 18704 },
        [1225] = { 18705, 18706, 18707 },
        [1226] = { 18708 },
        [1227] = { 18709, 18710 },
        [1242] = { 18731, 18743, 18744 },
        [1243] = { 18754, 18755, 18756 },
        [1244] = { 23785, 23822, 23823, 23824, 23825 },
        [1261] = { 18767, 18768 },
        [1262] = { 18769, 18770, 18771, 18772, 18773 },
        [1263] = { 35691, 35692, 35693 },
        [1281] = { 30326 },
        [1282] = { 19028 },
        [1283] = { 47245, 47246, 47247 },
        [1284] = { 18827, 18829 },
        [1303] = { 19168, 19180, 19181, 24296, 24297 },
        [1304] = { 19184, 19387, 19388 },
        [1305] = { 19376, 63457, 63458 },
        [1306] = { 56342, 56343, 56344 },
        [1309] = { 19286, 19287 },
        [1310] = { 19290, 19294, 24283 },
        [1311] = { 19295, 19297, 19298 },
        [1312] = { 19306 },
        [1321] = { 19370, 19371, 19373 },
        [1322] = { 3674 },
        [1325] = { 19386 },
        [1341] = { 19407, 19412 },
        [1342] = { 19416, 19417, 19418, 19419, 19420 },
        [1343] = { 19421, 19422, 19423 },
        [1344] = { 19426, 19427, 19429, 19430, 19431 },
        [1345] = { 19434 },
        [1346] = { 19454, 19455, 19456 },
        [1347] = { 19461, 19462, 24691 },
        [1348] = { 19464, 19465, 19466 },
        [1349] = { 19485, 19487, 19488, 19489, 19490 },
        [1351] = { 35100, 35102 },
        [1353] = { 23989 },
        [1361] = { 19506 },
        [1362] = { 19507, 19508, 19509 },
        [1381] = { 19549, 19550, 19551 },
        [1382] = { 19552, 19553, 19554, 19555, 19556 },
        [1384] = { 19559, 19560 },
        [1385] = { 19572, 19573 },
        [1386] = { 19574 },
        [1387] = { 19577 },
        [1388] = { 19578, 20895 },
        [1389] = { 19583, 19584, 19585, 19586, 19587 },
        [1390] = { 19590, 19592 },
        [1393] = { 19598, 19599, 19600, 19601, 19602 },
        [1395] = { 19609, 19610, 19612 },
        [1396] = { 19616, 19617, 19618, 19619, 19620 },
        [1397] = { 19621, 19622, 19623, 19624, 19625 },
        [1401] = { 20042, 20045 },
        [1402] = { 20049, 20056, 20057 },
        [1403] = { 20060, 20061, 20062, 20063, 20064 },
        [1407] = { 20101, 20102, 20103, 20104, 20105 },
        [1410] = { 20111, 20112, 20113 },
        [1411] = { 20117, 20118, 20119, 20120, 20121 },
        [1421] = { 20127, 20130, 20135 },
        [1422] = { 20138, 20139, 20140 },
        [1423] = { 20143, 20144, 20145, 20146, 20147 },
        [1425] = { 20174, 20175 },
        [1426] = { 20177, 20179, 20181, 20180, 20182 },
        [1429] = { 20196, 20197, 20198 },
        [1430] = { 20925 },
        [1431] = { 20911 },
        [1432] = { 20205, 20206, 20207, 20209, 20208 },
        [1433] = { 20216 },
        [1435] = { 31821 },
        [1441] = { 20066 },
        [1442] = { 63646, 63647, 63648, 63649, 63650 },
        [1443] = { 20234, 20235 },
        [1444] = { 20237, 20238, 20239 },
        [1446] = { 20244, 20245 },
        [1449] = { 20257, 20258, 20259, 20260, 20261 },
        [1450] = { 20254, 20255, 20256 },
        [1461] = { 20210, 20212, 20213, 20214, 20215 },
        [1463] = { 20224, 20225, 20330, 20331, 20332 },
        [1464] = { 20335, 20336, 20337 },
        [1465] = { 20359, 20360, 20361 },
        [1481] = { 20375 },
        [1501] = { 20468, 20469, 20470 },
        [1502] = { 20473 },
        [1521] = { 20487, 20488 },
        [1541] = { 20500, 20501 },
        [1542] = { 20502, 20503 },
        [1543] = { 29888, 29889 },
        [1561] = { 20711 },
        [1581] = { 23584, 23585, 23586, 23587, 23588 },
        [1601] = { 12298, 12724, 12725, 12726, 12727 },
        [1621] = { 19159, 19160 },
        [1622] = { 19255, 19256, 19257, 19258, 19259 },
        [1623] = { 52783, 52785, 52786, 52787, 52788 },
        [1624] = { 35029, 35030 },
        [1625] = { 24443, 19575 },
        [1627] = { 5923, 5924, 5925, 5926, 25829 },
        [1628] = { 9453, 25836 },
        [1629] = { 20096, 20097, 20098, 20099, 20100 },
        [1631] = { 25956, 25957 },
        [1632] = { 9799, 25988 },
        [1633] = { 9452, 26016 },
        [1634] = { 26022, 26023 },
        [1635] = { 27789, 27790 },
        [1636] = { 27811, 27815, 27816 },
        [1637] = { 724 },
        [1638] = { 27839, 27840 },
        [1639] = { 29074, 29075, 29076 },
        [1640] = { 28996, 28997, 28998 },
        [1641] = { 28999, 29000 },
        [1642] = { 29062, 29064, 29065 },
        [1643] = { 29082, 29084, 29086 },
        [1645] = { 30160, 29179, 29180 },
        [1646] = { 29187, 29189, 29191 },
        [1647] = { 29192, 29193 },
        [1648] = { 29206, 29205, 29202 },
        [1649] = { 29438, 29439, 29440 },
        [1650] = { 29441, 29444 },
        [1652] = { 29593, 29594 },
        [1653] = { 29140, 29143, 29144 },
        [1654] = { 29598, 29599 },
        [1655] = { 29721, 29776 },
        [1657] = { 29590, 29591, 29592 },
        [1658] = { 29759, 29760, 29761, 29762, 29763 },
        [1659] = { 29801 },
        [1660] = { 29787, 29790, 29792 },
        [1661] = { 29623 },
        [1662] = { 29723, 29725, 29724 },
        [1663] = { 29834, 29838 },
        [1664] = { 29836, 29859 },
        [1666] = { 20243 },
        [1667] = { 32477, 32483, 32484 },
        [1668] = { 30054, 30057 },
        [1669] = { 30060, 30061, 30062, 30063, 30064 },
        [1670] = { 30108 },
        [1671] = { 30143, 30144, 30145 },
        [1672] = { 30146 },
        [1673] = { 30242, 30245, 30246, 30247, 30248 },
        [1676] = { 30283 },
        [1677] = { 30288, 30289, 30290, 30291, 30292 },
        [1678] = { 30293, 30295, 30296 },
        [1679] = { 30299, 30301, 30302 },
        [1680] = { 30319, 30320, 30321 },
        [1682] = { 30664, 30665, 30666 },
        [1685] = { 30672, 30673, 30674 },
        [1686] = { 30675, 30678, 30679 },
        [1687] = { 30706 },
        [1689] = { 30802, 30808, 30809 },
        [1690] = { 30798 },
        [1691] = { 30812, 30813, 30814 },
        [1692] = { 30816, 30818, 30819 },
        [1693] = { 30823 },
        [1695] = { 30864, 30865, 30866 },
        [1696] = { 30867, 30868, 30869 },
        [1697] = { 30872, 30873 },
        [1698] = { 974 },
        [1699] = { 30881, 30883, 30884, 30885, 30886 },
        [1700] = { 30892, 30893 },
        [1701] = { 30894, 30895 },
        [1702] = { 30902, 30903, 30904, 30905, 30906 },
        [1703] = { 30919, 30920 },
        [1705] = { 31122, 31123, 61329 },
        [1706] = { 31124, 31126 },
        [1707] = { 31130, 31131 },
        [1709] = { 32601 },
        [1711] = { 31211, 31212, 31213 },
        [1712] = { 31216, 31217, 31218, 31219, 31220 },
        [1713] = { 31221, 31222, 31223 },
        [1714] = { 36554 },
        [1715] = { 31226, 31227, 58410 },
        [1718] = { 31234, 31235, 31236 },
        [1719] = { 1329 },
        [1721] = { 31208, 31209 },
        [1722] = { 31228, 31229, 31230 },
        [1723] = { 31380, 31382, 31383 },
        [1724] = { 31569, 31570 },
        [1725] = { 31571, 31572 },
        [1726] = { 31574, 31575, 54354 },
        [1727] = { 31579, 31582, 31583 },
        [1728] = { 31584, 31585, 31586, 31587, 31588 },
        [1729] = { 31589 },
        [1730] = { 31638, 31639, 31640 },
        [1731] = { 31641, 31642 },
        [1732] = { 31679, 31680 },
        [1733] = { 34293, 34295, 34296 },
        [1734] = { 31656, 31657, 31658 },
        [1735] = { 31661 },
        [1736] = { 31667, 31668, 31669 },
        [1737] = { 55091, 55092 },
        [1738] = { 31674, 31675, 31676, 31677, 31678 },
        [1740] = { 31682, 31683 },
        [1741] = { 31687 },
        [1742] = { 31822, 31823 },
        [1743] = { 31825, 31826 },
        [1744] = { 31828, 31829, 31830 },
        [1745] = { 31833, 31835, 31836 },
        [1746] = { 31837, 31838, 31839, 31840, 31841 },
        [1747] = { 31842 },
        [1748] = { 31844, 31845, 53519 },
        [1750] = { 31848, 31849 },
        [1751] = { 31850, 31851, 31852 },
        [1753] = { 31858, 31859, 31860 },
        [1754] = { 31935 },
        [1755] = { 31866, 31867, 31868 },
        [1756] = { 31869 },
        [1757] = { 31871, 31872 },
        [1758] = { 31876, 31877, 31878 },
        [1759] = { 31879, 31880, 31881 },
        [1761] = { 32043, 35396, 35397 },
        [1762] = { 31244, 31245 },
        [1763] = { 32385, 32387, 32392, 32393, 32394 },
        [1764] = { 32381, 32382, 32383 },
        [1765] = { 33142, 33145, 33146 },
        [1766] = { 33150, 33154 },
        [1767] = { 33158, 33159, 33160, 33161, 33162 },
        [1768] = { 34753, 34859, 34860 },
        [1769] = { 33167, 33171, 33172 },
        [1771] = { 33186, 33190 },
        [1772] = { 34908, 34909, 34910 },
        [1773] = { 63504, 63505, 63506 },
        [1774] = { 33206 },
        [1777] = { 33213, 33214, 33215 },
        [1778] = { 33221, 33222, 33223, 33224, 33225 },
        [1779] = { 34914 },
        [1781] = { 14910, 33371 },
        [1782] = { 33589, 33590, 33591 },
        [1783] = { 33592, 33596 },
        [1784] = { 33597, 33599, 33956 },
        [1785] = { 33600, 33601, 33602 },
        [1786] = { 33603, 33604, 33605, 33606, 33607 },
        [1787] = { 33831 },
        [1788] = { 33879, 33880 },
        [1789] = { 33886, 33887, 33888, 33889, 33890 },
        [1790] = { 33881, 33882, 33883 },
        [1791] = { 65139 },
        [1792] = { 33872, 33873 },
        [1793] = { 33851, 33852, 33957 },
        [1794] = { 33853, 33855, 33856 },
        [1795] = { 33859, 33866, 33867 },
        [1796] = { 33917 },
        [1797] = { 34151, 34152, 34153 },
        [1798] = { 34297, 34300 },
        [1799] = { 34453, 34454 },
        [1800] = { 34455, 34459, 34460 },
        [1801] = { 34462, 34464, 34465 },
        [1802] = { 34466, 34467, 34468, 34469, 34470 },
        [1803] = { 34692 },
        [1804] = { 34475, 34476 },
        [1806] = { 34482, 34483, 34484 },
        [1807] = { 34485, 34486, 34487, 34488, 34489 },
        [1808] = { 34490 },
        [1809] = { 34491, 34492, 34493 },
        [1810] = { 34494, 34496 },
        [1811] = { 34497, 34498, 34499 },
        [1812] = { 34500, 34502, 34503 },
        [1813] = { 34506, 34507, 34508, 34838, 34839 },
        [1814] = { 19503 },
        [1815] = { 34861 },
        [1816] = { 33191, 33192, 33193 },
        [1817] = { 34935, 34938, 34939 },
        [1818] = { 34950, 34954 },
        [1819] = { 34948, 34949 },
        [1820] = { 19498, 19499, 19500 },
        [1821] = { 35104, 35110, 35111 },
        [1822] = { 35363, 35364 },
        [1823] = { 35395 },
        [1824] = { 35446, 35448, 35449 },
        [1825] = { 35541, 35550, 35551, 35552, 35553 },
        [1826] = { 35578, 35581 },
        [1827] = { 14165, 14166 },
        [1843] = { 44378, 44379 },
        [1844] = { 44394, 44395, 44396 },
        [1845] = { 44397, 44398, 44399 },
        [1846] = { 44400, 44402, 44403 },
        [1847] = { 44425 },
        [1848] = { 64353, 64357 },
        [1849] = { 44442, 44443 },
        [1850] = { 44445, 44446, 44448 },
        [1851] = { 44449, 44469, 44470, 44471, 44472 },
        [1852] = { 44457 },
        [1853] = { 44543, 44545 },
        [1854] = { 44546, 44548, 44549 },
        [1855] = { 44557, 44560, 44561 },
        [1856] = { 44566, 44567, 44568, 44570, 44571 },
        [1857] = { 44572 },
        [1858] = { 45234, 45243, 45244 },
        [1859] = { 46854, 46855 },
        [1860] = { 46859, 46860 },
        [1862] = { 46865, 46866 },
        [1863] = { 46924 },
        [1864] = { 46908, 46909, 56924 },
        [1865] = { 46910, 46911 },
        [1866] = { 46913, 46914, 46915 },
        [1867] = { 46917 },
        [1868] = { 60970 },
        [1870] = { 46945, 46949 },
        [1871] = { 46951, 46952, 46953 },
        [1872] = { 46968 },
        [1873] = { 54037, 54038 },
        [1875] = { 47198, 47199, 47200 },
        [1876] = { 47201, 47202, 47203, 47204, 47205 },
        [1878] = { 47195, 47196, 47197 },
        [1880] = { 47193 },
        [1882] = { 54347, 54348, 54349 },
        [1883] = { 47230, 47231 },
        [1884] = { 63117, 63121, 63123 },
        [1885] = { 47236, 47237, 47238, 47239, 47240 },
        [1886] = { 59672 },
        [1887] = { 63349, 63350, 63351 },
        [1888] = { 47258, 47259, 47260 },
        [1889] = { 54117, 54118 },
        [1890] = { 47266, 47267, 47268, 47269, 47270 },
        [1891] = { 50796 },
        [1893] = { 47294, 47295, 47296 },
        [1894] = { 47507, 47508 },
        [1895] = { 47509, 47511, 47515 },
        [1896] = { 47535, 47536, 47537 },
        [1897] = { 47540 },
        [1898] = { 47586, 47587, 47588, 52802, 52803 },
        [1901] = { 47516, 47517 },
        [1902] = { 63534, 63542, 63543 },
        [1903] = { 47558, 47559, 47560 },
        [1904] = { 63730, 63733, 63737 },
        [1905] = { 47562, 47564, 47565, 47566, 47567 },
        [1906] = { 47569, 47570 },
        [1907] = { 47573, 47577, 47578, 51166, 51167 },
        [1908] = { 64044 },
        [1909] = { 47580, 47581, 47582 },
        [1910] = { 47585 },
        [1911] = { 47788 },
        [1912] = { 48384, 48395, 48396 },
        [1913] = { 48389, 48392, 48393 },
        [1914] = { 48409, 48410 },
        [1915] = { 48411, 48412 },
        [1916] = { 51179, 51180, 51181, 51182, 51183 },
        [1917] = { 48438 },
        [1918] = { 48432, 48433, 48434, 51268, 51269 },
        [1919] = { 48483, 48484, 48485 },
        [1920] = { 48532, 48489, 48491 },
        [1921] = { 48492, 48494, 48495 },
        [1922] = { 48496, 48499, 48500 },
        [1923] = { 50516 },
        [1924] = { 48516, 48521, 48525 },
        [1925] = { 48488, 48514 },
        [1926] = { 48505 },
        [1927] = { 50334 },
        [1928] = { 48506, 48510, 48511 },
        [1929] = { 48539, 48544, 48545 },
        [1930] = { 48535, 48536, 48537 },
        [1932] = { 48962, 49567, 49568 },
        [1933] = { 48963, 49564, 49565 },
        [1934] = { 48965, 49571, 49572 },
        [1936] = { 50365, 50371 },
        [1938] = { 48978, 49390, 49391, 49392, 49393 },
        [1939] = { 48979, 49483 },
        [1941] = { 48982 },
        [1942] = { 48985, 49488, 49489 },
        [1943] = { 48987, 49477, 49478, 49479, 49480 },
        [1944] = { 48988, 49503, 49504 },
        [1945] = { 48997, 49490, 49491 },
        [1948] = { 49004, 49508, 49509 },
        [1949] = { 49005 },
        [1950] = { 49006, 49526, 50029 },
        [1953] = { 49015, 50154, 55136 },
        [1954] = { 49016 },
        [1955] = { 49018, 49529, 49530 },
        [1957] = { 55050 },
        [1958] = { 49023, 49533, 49534 },
        [1959] = { 49189, 50149, 50150 },
        [1960] = { 49027, 49542, 49543 },
        [1961] = { 49028 },
        [1962] = { 49032, 49631, 49632 },
        [1963] = { 49036, 49562 },
        [1968] = { 49042, 49786, 49787, 49788, 49789 },
        [1971] = { 49137, 49657 },
        [1973] = { 49140, 49661, 49662, 49663, 49664 },
        [1975] = { 49143 },
        [1979] = { 51271 },
        [1980] = { 49796 },
        [1981] = { 49149, 50115 },
        [1984] = { 52143 },
        [1985] = { 49158 },
        [1989] = { 49184 },
        [1990] = { 49186, 51108, 51109 },
        [1992] = { 49188, 56822, 59057 },
        [1993] = { 49024, 49538 },
        [1996] = { 49194 },
        [1997] = { 49200, 50151, 50152 },
        [1998] = { 49202, 50127, 50128, 50129, 50130 },
        [1999] = { 49203 },
        [2000] = { 49206 },
        [2001] = { 49208, 56834, 56835 },
        [2003] = { 49217, 49654, 49655 },
        [2004] = { 49219, 49627, 49628 },
        [2005] = { 49220, 49633, 49635, 49636, 49638 },
        [2007] = { 49222 },
        [2008] = { 49013, 55236, 55237 },
        [2009] = { 49224, 49610, 49611 },
        [2011] = { 49223, 49599 },
        [2013] = { 50391, 50392 },
        [2015] = { 48977, 49394, 49395 },
        [2017] = { 49182, 49500, 49501, 55225, 55226 },
        [2018] = { 49145, 49495, 49497 },
        [2019] = { 55233 },
        [2020] = { 49455, 50147 },
        [2022] = { 49226, 50137, 50138 },
        [2025] = { 49588, 49589 },
        [2027] = { 15337, 15338 },
        [2029] = { 50384, 50385 },
        [2030] = { 49471, 49790, 49791 },
        [2031] = { 49175, 50031, 51456 },
        [2034] = { 61154, 61155, 61156, 61157, 61158 },
        [2035] = { 55061, 55062 },
        [2036] = { 50117, 50118, 50119, 50120, 50121 },
        [2039] = { 49146, 51267 },
        [2040] = { 50187, 50190, 50191 },
        [2041] = { 48181 },
        [2042] = { 50880, 50884, 50885, 50886, 50887 },
        [2043] = { 51099, 51160, 51161 },
        [2044] = { 51123, 51127, 51128, 51129, 51130 },
        [2045] = { 47220, 47221, 47223 },
        [2047] = { 51459, 51462, 51463, 51464, 51465 },
        [2048] = { 51468, 51472, 51473 },
        [2049] = { 51466, 51470 },
        [2050] = { 51474, 51478, 51479 },
        [2051] = { 51480, 51481, 51482 },
        [2052] = { 51483, 51485, 51486 },
        [2053] = { 51490 },
        [2054] = { 51521, 51522 },
        [2055] = { 51525, 51526, 51527 },
        [2056] = { 51523, 51524 },
        [2057] = { 51528, 51529, 51530, 51531, 51532 },
        [2058] = { 51533 },
        [2059] = { 51560, 51561 },
        [2060] = { 51554, 51555 },
        [2061] = { 51556, 51557, 51558 },
        [2063] = { 51562, 51563, 51564, 51565, 51566 },
        [2064] = { 61295 },
        [2065] = { 51625, 51626 },
        [2066] = { 51627, 51628, 51629 },
        [2068] = { 51632, 51633 },
        [2069] = { 51634, 51635, 51636 },
        [2070] = { 51664, 51665, 51667, 51668, 51669 },
        [2071] = { 51662 },
        [2072] = { 5952, 51679 },
        [2073] = { 51672, 51674 },
        [2074] = { 51682, 58413 },
        [2075] = { 51685, 51686, 51687, 51688, 51689 },
        [2076] = { 51690 },
        [2077] = { 51692, 51696 },
        [2078] = { 51698, 51700, 51701 },
        [2079] = { 58414, 58415 },
        [2080] = { 51708, 51709, 51710, 51711, 51712 },
        [2081] = { 51713 },
        [2082] = { 51745, 51746 },
        [2083] = { 51883, 51884, 51885 },
        [2084] = { 51886 },
        [2085] = { 63560 },
        [2086] = { 49467, 50033, 50034 },
        [2101] = { 16043, 16130 },
        [2105] = { 53137, 53138 },
        [2106] = { 61680, 61681, 52858 },
        [2107] = { 61682, 61683 },
        [2109] = { 61684 },
        [2110] = { 61680, 61681, 52858 },
        [2111] = { 61685 },
        [2112] = { 61686, 61687, 61688 },
        [2113] = { 61689, 61690 },
        [2114] = { 61682, 61683 },
        [2116] = { 61686, 61687, 61688 },
        [2117] = { 61689, 61690 },
        [2118] = { 61682, 61683 },
        [2119] = { 61684 },
        [2120] = { 61686, 61687, 61688 },
        [2121] = { 61689, 61690 },
        [2122] = { 53175, 53176 },
        [2123] = { 53178, 53179 },
        [2124] = { 53180, 53181 },
        [2125] = { 53182, 53183, 53184 },
        [2126] = { 53182, 53183, 53184 },
        [2127] = { 53182, 53183, 53184 },
        [2128] = { 53186, 53187 },
        [2129] = { 53203, 53204, 53205 },
        [2130] = { 53234, 53237, 53238 },
        [2131] = { 53228, 53232 },
        [2132] = { 53215, 53216, 53217 },
        [2133] = { 53221, 53222, 53224 },
        [2134] = { 53241, 53243, 53244, 53245, 53246 },
        [2135] = { 53209 },
        [2136] = { 53252, 53253 },
        [2137] = { 53256, 53259, 53260 },
        [2138] = { 53265 },
        [2139] = { 53270 },
        [2140] = { 53262, 53263, 53264 },
        [2141] = { 53295, 53296, 53297 },
        [2142] = { 53298, 53299 },
        [2143] = { 53302, 53303, 53304 },
        [2144] = { 53290, 53291, 53292 },
        [2145] = { 53301 },
        [2147] = { 53375, 53376 },
        [2148] = { 53379, 53484, 53648 },
        [2149] = { 53380, 53381, 53382 },
        [2150] = { 53385 },
        [2151] = { 19596 },
        [2152] = { 53409, 53411 },
        [2153] = { 53426 },
        [2154] = { 53427, 53429, 53430 },
        [2155] = { 53401 },
        [2156] = { 55709 },
        [2157] = { 53434 },
        [2160] = { 19596 },
        [2161] = { 53427, 53429, 53430 },
        [2162] = { 53409, 53411 },
        [2163] = { 53450, 53451 },
        [2165] = { 19596 },
        [2166] = { 61680, 61681, 52858 },
        [2167] = { 53409, 53411 },
        [2168] = { 53427, 53429, 53430 },
        [2169] = { 53476 },
        [2170] = { 53477 },
        [2171] = { 53478 },
        [2172] = { 53480 },
        [2173] = { 53481, 53482 },
        [2175] = { 53490 },
        [2176] = { 53486, 53488 },
        [2177] = { 52234, 53497 },
        [2179] = { 53501, 53502, 53503 },
        [2181] = { 53508 },
        [2182] = { 53514, 53516 },
        [2183] = { 53511, 53512 },
        [2184] = { 53517 },
        [2185] = { 20262, 20263, 20264, 20265, 20266 },
        [2190] = { 53551, 53552, 53553 },
        [2191] = { 53556, 53557 },
        [2192] = { 53563 },
        [2193] = { 53569, 53576 },
        [2194] = { 53583, 53585 },
        [2195] = { 53590, 53591, 53592 },
        [2196] = { 53595 },
        [2197] = { 53620, 53621, 53622 },
        [2198] = { 53660, 53661 },
        [2199] = { 53671, 53673, 54151, 54154, 54155 },
        [2200] = { 53695, 53696 },
        [2201] = { 23145 },
        [2203] = { 23145 },
        [2204] = { 53709, 53710, 53711 },
        [2205] = { 53754, 53759 },
        [2206] = { 54044 },
        [2207] = { 53483, 53485 },
        [2208] = { 53554, 53555 },
        [2209] = { 44404, 54486, 54488, 54489, 54490 },
        [2210] = { 54639, 54638, 54637 },
        [2211] = { 54646 },
        [2212] = { 54747, 54749 },
        [2214] = { 44745, 54787 },
        [2215] = { 49039 },
        [2216] = { 55090 },
        [2217] = { 55107, 55108 },
        [2218] = { 55129, 55130, 55131, 55132, 55133 },
        [2219] = { 52825 },
        [2221] = { 51052 },
        [2222] = { 29447, 55339, 55340 },
        [2223] = { 55610 },
        [2225] = { 55620, 55623 },
        [2226] = { 55666, 55667 },
        [2227] = { 56314, 56315, 56316, 56317, 56318 },
        [2228] = { 56339, 56340, 56341 },
        [2229] = { 56333, 56336, 56337 },
        [2231] = { 46867, 56611, 56612, 56613, 56614 },
        [2232] = { 56636, 56637, 56638 },
        [2233] = { 12862, 12330 },
        [2234] = { 56927, 56929, 56930, 56931, 56932 },
        [2235] = { 57470, 57472 },
        [2236] = { 57499 },
        [2237] = { 61685 },
        [2238] = { 57810, 57811, 57812, 57813, 57814 },
        [2239] = { 57849, 57850, 57851 },
        [2240] = { 57865 },
        [2241] = { 57873, 57876, 57877 },
        [2242] = { 57878, 57880, 57881 },
        [2244] = { 14179, 58422, 58423, 58424, 58425 },
        [2245] = { 58435 },
        [2246] = { 58872, 58874 },
        [2247] = { 59088, 59089 },
        [2249] = { 60103 },
        [2250] = { 61216, 61221, 61222 },
        [2252] = { 62097, 62098, 62099, 62100, 62101 },
        [2253] = { 62758, 62762 },
        [2254] = { 62759, 62760 },
        [2255] = { 62758, 62762 },
        [2256] = { 62758, 62762 },
        [2257] = { 53450, 53451 },
        [2258] = { 62764, 62765 },
        [2259] = { 62905, 62908 },
        [2260] = { 50040, 50041, 50043 },
        [2261] = { 63156, 63158 },
        [2262] = { 63370, 63372 },
        [2263] = { 63373, 63374 },
        [2264] = { 63410, 63411 },
        [2266] = { 63503 },
        [2267] = { 63625, 63626, 63627 },
        [2268] = { 33201, 33202 },
        [2277] = { 63900 },
        [2278] = { 53480 },
        [2279] = { 64127, 64129 },
        [2280] = { 64205 },
        [2281] = { 53527, 53530 },
        [2282] = { 31785, 33776 },
        [2283] = { 64976 },
        [2284] = { 65661, 66191, 66192 },
        [2285] = { 66799, 66814, 66815, 66816, 66817 },
    }
end